<!DOCTYPE html>
<html>
<head>
<title>基层年报</title>
<div th:include="base-libs :: base-libs" />

<meta name="content-type" content="text/html; charset=UTF-8">
<style>
body {
	background: #fff;
	overflow: hidden;
	text-align: center;
}
.titleTd25{
			width:25%;
		}
.laydate-icon{
		    line-height: 28px;
		    background-color: #fff;
		    height: 28px;
		    border: 1px solid #B6B6B6;
		    border-radius: 5px;
		    width:84% !important;
		}
</style>
</head>
<script>
	$(function() {
        $(this).registerManagerPage({cacheTables:["TB_ZY_BBZT"],callback:initData});
		initView();
	})
	/*数据查询*/
	function initData(){
		var NF = $("#NF").val() || new Date().getFullYear();
		$.QuickRemote.AjaxJson("queryNbInfo", queryNbInfoHandler, {NF: NF});
	}
	/* 数据回调 */
	function queryNbInfoHandler(result){
		$(".form-control").each(function(){
			var name = $(this).attr('name');
			$(this).val(result[name]);
		})
		format(result);
	}
	function initView() {
		$("#btnTJ").click(function() {
			if ($(".form-control").QuickValidate()) {
				$.QuickRemote.AjaxFiledFormSubmit("queryForm",function(result) {
					var info = result["info"];
					if (result["state"]) {
						$.QuickAlert.alertNormal("保存成功！", {callback: function(){
							//$("#btnTj").hide();
							//location.reload();
                            initData()
						}});
					} else {
						$.QuickAlert.alertFail({
							content : info["faultInfo"]
						});
					}
				}, {ZT: 1});
			}
		})
		
		//审核记录
		$("body").on('click','#btnShjl',function(){
			StoreCache.setCache("BBID", $("#ID").val());
			parent.layer.open({
				  type: 2,
				  area: ["60%", "500px"],
				  content: contextRoot + 'wsj/bbShjl.html',
				  scrollbar: false,
				  resize: false,
				  title:'审核记录'
			});
		});
	}
	
	function format(param){
		var flag = param.SFTGZYYFW;
        if(flag=='0'){
            $(".fou").prop("checked",'true');
        }else{
            $(".shi").prop("checked",'true');
        }
		var zt = param.ZT;
        var bbztArr = StoreCache.getCache("TB_ZY_BBZT");
        if(!$.isEmptyObject(bbztArr) && !$.isEmptyObject(bbztArr = bbztArr.data)){
            var bbzt = "未填报";
            $.each(bbztArr, function(i,item){
                if(item.XMDM == zt){
                    bbzt = item.XMMC;
                    return false;
                }
            })
            $("#SHZT").val(bbzt);
        }

		if (zt == '1' || zt == '3') {
			$("input:not('#NF')").attr("disabled","disabled");
			$("#south").hide();
		} else{
            $("input:not('#NF')").removeAttr("disabled");
			$("#south").show();
		}
		 $('body').layout("resize");
	}
	
	function queryByNf(){
		$("#NF").val($dp.cal.newdate.y);
		initData();
	}
	
	
</script>
<body class="easyui-layout">
	<form id="queryForm" action="save">
	 	<input class="form-control" type="hidden" id="SFTGZYYFW" /> 
	    <input class="form-control" type="hidden" id="ID" name="ID"/> 
		<input class="form-control" type="hidden" id="YLJGID" name="YLJGID"/> 
		<input class="form-control" type="hidden" id="JGLB" name="JGLB"/> 
		<input class="form-control" type="hidden" id="XZQH" name="XZQH"/>
		<div region="north" style="height:60px;border:0;border-bottom:1px solid #ddd;overflow: hidden">
		<table class="form-table">
			<tr>
				<td class="td-text">审核状态：</td>
				<td class="td-content">
					<input id="SHZT" name="SHZT" class="form-control" readonly="readonly">
				</td>
				<td class="td-text">机构名称：</td>
				<td class="td-content">
					<input id="JGMC" name="JGMC" class="form-control" readOnly="readOnly">
				</td>
				<td class="td-text"><label>年份：</label></td>
				<td class="td-content">
					<input type="text" id="NF" name="NF" class="form-control laydate-icon" 
					onfocus="WdatePicker({dateFmt:'yyyy',readOnly:true,onpicking:queryByNf})"
					quick-config="label:'年份', validateProxy:'notNull length', length: '10'" />
				</td>
				<td>
					<button id="btnShjl" class="btn btn-info" type="button">审核记录</button>
				</td>
			</tr>
		</table>
		</div>
		<div region="center" border="false">
		<table class="form-table" style="margin-top:8px;">
			<tr>
				<td class="td-text titleTd25"><label>1.辖区户籍人口数：</label></td>
				<td class="td-content">
					<input id="XQHJRKS" name="XQHJRKS" class="form-control" type="text"
					quick-config="label:'辖区户籍人口数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text titleTd25"><label>2.辖区家庭户数：</label></td>
				<td class="td-content">
					<input id="XQJTHS" name="XQJTHS" class="form-control"
					quick-config="label:'辖区家庭户数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>3.普通人群数：</label></td>
				<td class="td-content">
					<input id="PTRQS" name="PTRQS" class="form-control"
					quick-config="label:'普通人群数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>4.重点人群数：</label></td>
				<td class="td-content">
					<input id="ZDRQS" name="ZDRQS" class="form-control"
					quick-config="label:'重点人群数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>5.65岁以上老年人数：</label></td>
				<td class="td-content">
					<input id="LNRRS" name="LNRRS" class="form-control dataField"
					quick-config="label:'65岁以上老年人数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>6.慢病人群数：</label></td>
				<td class="td-content">
					<input id="MBRQS" name="MBRQS" class="form-control"
					quick-config="label:'慢病人群数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>7.高血压人数：</label></td>
				<td class="td-content">
					<input id="GXYRS" name="GXYRS" class="form-control dataField"
					quick-config="label:'高血压人数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>8.糖尿病人数：</label></td>
				<td class="td-content">
					<input id="TNBRS" name="TNBRS" class="form-control"
					quick-config="label:'糖尿病人数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>9.孕产妇人数：</label></td>
				<td class="td-content">
					<input id="YCFRS" name="YCFRS" class="form-control dataField"
					quick-config="label:'孕产妇人数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>10.0~6岁儿童数：</label></td>
				<td class="td-content">
					<input id="ETS" name="ETS" class="form-control"
					quick-config="label:'0~6岁儿童数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>11.残疾人数：</label></td>
				<td class="td-content">
					<input id="CJRS" name="CJRS" class="form-control dataField" type="text"
					quick-config="label:'残疾人数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>12.精神病患者数：</label></td>
				<td class="td-content">
					<input id="JSBHZS" name="JSBHZS" class="form-control"
					quick-config="label:'精神病患者数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>13.医生总数：</label></td>
				<td class="td-content">
					<input id="YSZS" name="YSZS" class="form-control dataField" type="text"
					quick-config="label:'医生总数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>14.护士总数：</label></td>
				<td class="td-content">
					<input id="HSZS" name="HSZS" class="form-control"
					quick-config="label:'护士总数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>15.全科医生数：</label></td>
				<td class="td-content">
					<input id="QKYSS" name="QKYSS" class="form-control dataField" type="text"
					quick-config="label:'全科医生数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text"><label>16.是否提供中医药服务：</label></td>
				<td class="td-content">
					<input style="width:18px;float:left" type="radio" class="mycheck shi" name="SFTGZYYFW" value="1" checked="checked">
					<span style="float:left;margin-right:15px">是</span>
					
					<input class="mycheck fou" style="width:18px;float:left" type="radio" name="SFTGZYYFW" value="0" />
					<span style="float:left">否</span>
				</td>
			</tr>
		</table>
		</div>
	</form>
	<div region="south" id="south" style="height:45px;line-height:40px;text-align:center;border:0;border-top:1px solid #ddd">
		<div style=" margin:0 auto">
			<button id="btnTJ" class="btn btn-info" type="button">提交</button>
		</div>
	</div>

</body>
</html>
